package cn.itbox.example.application.test.four;

public class FunctionInterfaceExample {

    public static void main(String[] args) {
        String hello = "hello";

        handle(t->System.out.println(t),hello);
    }


    public static <T> void handle(Handler<T> handler, T t) {

        System.out.println("before");
        handler.doHandle(t);
        System.out.println("after");
    }
}



@FunctionalInterface
interface Handler<T>{
    void doHandle(T t);
}